package com.atguigu.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class TestController {

    @RequestMapping("/")
    public String index() {
        return "index";
    }

    @RequestMapping("/testpath/{id}")
    public String testpath(@PathVariable("id") Integer id) {
        System.out.println("id:" + id);
        return "success";
    }

    @RequestMapping("/testRequestParam")
    public String testRequestParam(@RequestParam("username") String username ,@RequestParam("id")  String id){
        System.out.println(username);
        System.out.println(id);
        return "success";
    }


}
